﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Inspector.Modules
{
    public partial class _System : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void dropSelector_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var list = new List<string>();
                list.AddRange(new string[]{
            "Win32_ACE",
            "Win32_ActionCheck",
            "Win32_AllocatedResource",
            "Win32_ApplicationCommandLine",
            "Win32_ApplicationService",
            "Win32_ApplicationCommandLine",
            "Win32_ApplicationService",
            "Win32_Account",
            "Win32_AccountSID",
            "Win32_ACE",
            "Win32_ActionCheck",
            "Win32_AllocatedResource",
            "Win32_AssociatedBattery",
            "Win32_AssociatedProcessorMemory",
            "Win32_Process",
            "Win32_ProcessStartup",
            "Win32_Product",
            "Win32_ProductCheck",
            "Win32_ProductResource",
            "Win32_ProductSoftwareFeatures",
            "Win32_ProgIDSpecification",
            "Win32_ProgramGroup",
            "Win32_ProgramGroupContents",
            "Win32_ProgramGroupOrItem",
            "Win32_Property",
            "Win32_ProtocolBinding",
            "Win32_PublishComponentAction",
            "Win32_QuickFixEngineering",
            "Win32_Refrigeration",
            "Win32_Registry",
            "Win32_RegistryAction",
            "Win32_SystemAccount",
            "Win32_SystemBIOS",
            "Win32_SystemBootConfiguration",
            "Win32_SystemDesktop",
            "Win32_SystemDevices",
            "Win32_SystemDriver",
            "Win32_SystemDriverPNPEntity",
            "Win32_SystemEnclosure",
            "Win32_SystemLoadOrderGroups",
            "Win32_SystemLogicalMemoryConfiguration",
            "Win32_SystemMemoryResource",
            "Win32_SystemOperatingSystem",
            "Win32_SystemPartitions",
            "Win32_SystemProcesses",
            "Win32_SystemProgramGroups",
            "Win32_SystemResources",
            "Win32_SystemServices",
            "Win32_SystemSetting",
            "Win32_SystemSlot",
            "Win32_SystemSystemDriver",
            "Win32_SystemTimeZone",
            "Win32_ComputerSystem",
            "Win32_ComputerSystemProcessor",
            "Win32_ComputerSystemProduct",
            "Win32_Service",
            "Win32_ServiceControl",
            "Win32_ServiceSpecification",
            "Win32_ServiceSpecificationService"});
                foreach (var item in list)
                {
                    dropSelector.Items.Add(new ListItem(item, item));
                }
            }
        }

        protected void dropSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            mainGrid.DataSource = InspectorUtils.GetMachineProperties(dropSelector.SelectedValue);
            mainGrid.DataBind();
        }
    }
}